<?php
    @include_once("conn.php");
    @include_once("common.php");

    $id=$_GET["id"];
    if(!$id){
        $msg = array();
        $msg["status"] = false; 
        $msg["detail"] = "请传入完整参数"; 
        exit(json_encode($msg));
    }

    $reasch="delete from `study` where id in($id)";

    mysqli_query($conn,$reasch);

    $row=mysqli_affected_rows($conn); 
    // echo $row;
    
    $obj = array();
    if($rows>0){
        $obj["status"] = true;
        $obj["detail"] = "删除成功";
    }else if($rows == 0){
        
        $obj["status"] = true; 
        $obj["detail"] = "数据已经删除"; 
    }else{
        $obj["status"] = false;
        $obj["detail"] = "删除失败";
        $obj["sql"] = $del;  // 主要为了帮助查看bug
    }
    echo json_encode($obj);
?>